$(document).ready(function(){
	$(".Notice_Customer_Link").click(function(){
		var id = $(this).attr("id");
		$('#frmNotice_PropertyValue').attr("name","customerInfo.customerId");
		$('#frmNotice_PropertyValue').val(id);
		
		$('#frmNotice').attr('action',ACCOUNT_VIEW_PROFILE_URL);
    	$('#frmNotice').submit();
		
	});

	
	$(".Notice_Confirm_Request_Button").click(function(){
		return responseToFriendRequest(this, FRIEND_REQUEST_CONFIRM_URL);
	});
	
	$(".Notice_Ignore_Request_Button").click(function(){
		return responseToFriendRequest(this, FRIEND_REQUEST_IGNORE_URL);
	});
});

function responseToFriendRequest(o, url){
	//console.log(o);
	var id = $(o).attr("id");
	var friendId = $('#' + id + '_friendId').val();
	//console.log(friendId);
	var rowId = id + "_row";
	
	$.ajax({
		url : url + "?friendInfo.friendId=" + friendId
		, success: function (data){
			$("#" + rowId).remove();
		}
	});
	
	return false;
}
